MSVC warning cleanup (#202)
authortsteven4 <tsteven4@users.noreply.github.com>
Wed, 20 Jun 2018 22:51:29 +0000 (16:51 -0600)
committerGitHub <noreply@github.com>
Wed, 20 Jun 2018 22:51:29 +0000 (16:51 -0600)
enigma.cc
garmin_gpi.cc
jeeps/gpscom.cc
jeeps/gpsserial.cc
jeeps/gpsusbwin.cc
magproto.cc

index 9fbf0ef017ff13ad9ae84b34e50107b4ec8eb5ee..5ecd4ece6a6d6caca58984203a4c0aaedf100b8b 100644 (file)
--- a/enigma.cc
+++ b/enigma.cc
@@ -160,10 +160,10 @@ wr_init(const QString& fname)
 }
 
 #ifndef min
-#define min(a,b) ((a) < (b)) ? (a) : (b)
+#define min(a,b) (((a) < (b)) ? (a) : (b))
 #endif
 #ifndef max
-#define max(a,b) ((a) > (b)) ? (a) : (b)
+#define max(a,b) (((a) > (b)) ? (a) : (b))
 #endif
 
 static void
@@ -180,11 +180,11 @@ enigma_waypt_disp(const Waypoint* wpt)
     le_write32(&ewpt.data.wp_altitude, METERS_TO_FEET(wpt->altitude) + 1000);
   }
   if (wpt->shortname != nullptr) {
-    ewpt.shortname_len = min(6, strlen(CSTRc(wpt->shortname)));
+    ewpt.shortname_len = (uint8_t) min(6, strlen(CSTRc(wpt->shortname)));
     strncpy(ewpt.shortname, CSTRc(wpt->shortname), 6);
   }
   if (wpt->description != nullptr) {
-    ewpt.longname_len = min(27, strlen(CSTRc(wpt->description)));
+    ewpt.longname_len = (uint8_t) min(27, strlen(CSTRc(wpt->description)));
     strncpy(ewpt.longname, CSTRc(wpt->description), 27);
   }
   gbfwrite(&ewpt, sizeof(ewpt), 1, file_out);
index 1883082cb796a28ae3fd5fca028c3da8545a4e0a..f2fd6dfea08c1332749ad40b9aa01eff68dcb22a 100644 (file)
@@ -244,7 +244,7 @@ gpi_gmsd_init(Waypoint* wpt)
 }
 
 static char*
-gpi_read_lc_string_old(const char* field, char* languagecode, short* length)
+gpi_read_lc_string_old(char* languagecode, short* length)
 {
   char lc[3];
   short len;
@@ -291,9 +291,9 @@ gpi_read_string_old(const char* field)
       is_fatal((gbfgetc(fin) != 0),
                MYNAME ": Error reading field '%s'!", field);
 
-      res1 = gpi_read_lc_string_old(field, lc1,  &l1);
+      res1 = gpi_read_lc_string_old(lc1,  &l1);
       if ((l1 + 4) < l0) { // dual language?
-        res2 = gpi_read_lc_string_old(field, lc2,  &l2);
+        res2 = gpi_read_lc_string_old(lc2,  &l2);
         is_fatal((l1 + 4 + l2 + 4 != l0),
                  MYNAME ": Error out of sync (wrong size %d/%d/%d) on field '%s'!", l0, l1, l2, field);
         if (opt_lang && (strcmp(opt_lang, lc1) == 0)) {
index 6d20f3a48f160dca8f5d952b0775712a1aa34ef7..42f3cd1dd6a338a496c259f8e60a3f0f528ee9ec 100644 (file)
@@ -1308,22 +1308,22 @@ int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32
 }
 
 /*Stubs for unimplemented stuff*/
-int32  GPS_Command_Get_Workout(const char*, void**, int (*cb)(int, struct GPS_SWay**))
+int32  GPS_Command_Get_Workout(const char* /* port */, void** /* lap */, int (* /* cb */)(int, struct GPS_SWay**))
 {
   return 0;
 }
 
-int32  GPS_Command_Get_Fitness_User_Profile(const char* port, void** lap, int (*cb)(int, struct GPS_SWay**))
+int32  GPS_Command_Get_Fitness_User_Profile(const char* /* port */, void**  /* lap */, int (* /* cb */)(int, struct GPS_SWay**))
 {
   return 0;
 }
 
-int32  GPS_Command_Get_Workout_Limits(const char* port, void** lap, int (*cb)(int, struct GPS_SWay**))
+int32  GPS_Command_Get_Workout_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, struct GPS_SWay**))
 {
   return 0;
 }
 
-int32  GPS_Command_Get_Course_Limits(const char* port, void** lap, int (*cb)(int, struct GPS_SWay**))
+int32  GPS_Command_Get_Course_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, struct GPS_SWay**))
 {
   return 0;
 }
index 783d3b3d2d74129da40b3c5c2cdd4d42ea286c54..2ccd1f3024320e63ac181f24a6e05c9ea51f6686 100644 (file)
@@ -191,7 +191,7 @@ int32 GPS_Serial_Wait(gpsdevh* fd)
   return GPS_Serial_Chars_Ready(fd);
 }
 
-int32 GPS_Serial_Flush(gpsdevh* fd)
+int32 GPS_Serial_Flush(gpsdevh* /* fd */)
 {
   return 1;
 }
index f14ff7e85e16a3213bc0f991235a2f849ad61196..79fe3084207f987f2f218e5f5fc06b85edf15b88 100644 (file)
@@ -58,7 +58,7 @@ static int usb_tx_packet_size ;
 static const gdx_info* gdx;
 
 static int
-gusb_win_close(gpsdevh* handle)
+gusb_win_close(gpsdevh* /* handle */)
 {
   if (usb_handle != INVALID_HANDLE_VALUE) {
     CloseHandle(usb_handle);
index ac91e13def98591e2ee2281cea141d7662bee4d1..22634b5d5badbd85882b3d0603fb3553645d6553 100644 (file)
@@ -1612,21 +1612,25 @@ const char** os_get_magellan_mountpoints()
 
 // My kingdom for container classes and portable tree-walking...
 // Returns a pointer to a static vector that's valid until the next call.
+#if HAVE_GLOB
 static char**
 os_gpx_files(const char* dirname)
 {
-#if HAVE_GLOB
   static glob_t g;
   char* path;
   xasprintf(&path, "%s/*.gpx", dirname);
   glob(path, 0, nullptr, &g);
   xfree(path);
   return g.gl_pathv;
+}
 #else
+static char**
+os_gpx_files(const char* /* dirname */)
+{
   fatal("Not implemented");
   return NULL;
-#endif
 }
+#endif
 
 /*
  *  This is repeated just so it shows up as separate menu options